import api from '../../../http/api';
import { CATEGORY_DARA } from './actionsTypes.js';

export const getCategory = (obj) => {
    return {
        type: CATEGORY_DARA,
        obj: obj
    }
}

const getCategoryApi = () => {
  return (dispatch) => {
    api.getCategory().then((res) => {
      const action = getCategory({
        items: res.data.primary_filter
      });
      // 触发action操作
      dispatch(action);
    })
  }
}

export default getCategoryApi
